import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenMiniappDomainsController } from '../../../controllers';
const uctoowechatopenMiniappDomainsRouter = new Router();
const wechatopenMiniappDomainsController = new uctooWechatopenMiniappDomainsController();

uctoowechatopenMiniappDomainsRouter.post('/add', requireUser, wechatopenMiniappDomainsController.add);
uctoowechatopenMiniappDomainsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_miniapp_domains'), wechatopenMiniappDomainsController.edit);
uctoowechatopenMiniappDomainsRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_miniapp_domains'), wechatopenMiniappDomainsController.delete);

//For getting wechatopenMiniappDomains with permission control
uctoowechatopenMiniappDomainsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_domains'), wechatopenMiniappDomainsController.getSingle);
uctoowechatopenMiniappDomainsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_domains'), wechatopenMiniappDomainsController.getMany);
uctoowechatopenMiniappDomainsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_miniapp_domains'), wechatopenMiniappDomainsController.getMany);

//#endregion AutoCreateCode
export default uctoowechatopenMiniappDomainsRouter;
